﻿using Microsoft.AspNetCore.Builder;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace IotWeek2Day9.WebApi.Middlewares
{
    /// <summary>
    /// 写一个扩展方法，来注册自定义的中间件
    /// </summary>
    public static class RequestLogMiddlewareExt
    {
        //扩展方法
        public static IApplicationBuilder UseRequestLog(this IApplicationBuilder app)
        {
            return app.UseMiddleware<RequestLogMiddleware>(); //使用了自定义的中间件类

        }
    }
}
